package edu.hz.enums;

import lombok.Getter;

@Getter
public enum DonationType {

    MONEY("money"),
    GOODS("goods");

    private final String value;

    DonationType(String value) {
        this.value = value;
    }

    public static DonationType fromValue(String value) {
        for (DonationType type : DonationType.values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        return MONEY;
    }

}
